package com.demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.demo.dao.UserDao;
import com.demo.entity.User;
import com.demo.service.UserService;

@Component("userService")
public class UserServiceImpl implements UserService {

	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}
	@Resource
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	/**
	 * 
	 * @param name
	 * @param password
	 * @return boolean
	 */
	public boolean checkNameAndPwd(String name,String password){
		
		List<User> list = userDao.load(name, password);
		
		if(list.size()>0){
			return true;
		}
		return false;
	}
}
